<?php /*a:3:{s:51:"/www/wwwroot/ams/app/index/view/user/user_edit.html";i:1588827941;s:50:"/www/wwwroot/ams/app/index/view/public/header.html";i:1588821168;s:50:"/www/wwwroot/ams/app/index/view/public/footer.html";i:1588491103;}*/ ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <link rel="apple-touch-icon" sizes="76x76" href="/static/index/moban/assets/img/apple-icon.png">
    <link rel="icon" type="image/png" href="/static/index/moban/assets/img/favicon.png">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>首页 | <?php echo htmlentities($system_name); ?></title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
        name='viewport' />
    <link href="/static/index/moban/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/static/index/moban/assets/css/now-ui-kit.css?v=1.1.0" rel="stylesheet" />
</head>

<body class="index-page sidebar-collapse">

    <!-- 引入导航栏 -->
    <nav class="navbar navbar-expand-lg bg-info fixed-top">
    <div class="container">
        <div class="navbar-translate">
            <div class="navbar-brand text-white" style="font-size: 22px;"><?php echo htmlentities($system_name); ?></div>
            <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
                data-target="#example-navbar-info" aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-bar bar1"></span>
                <span class="navbar-toggler-bar bar2"></span>
                <span class="navbar-toggler-bar bar3"></span>
            </button>
        </div>

        <div class="collapse navbar-collapse justify-content-end has-image" id="example-navbar-info">
            <ul class="navbar-nav">
                <li class="nav-item" style="float: right;">
                    <a class="nav-link" href="<?php echo url('index/index'); ?>">
                        <p style="font-size: 16px;">首页</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('index/notice_list'); ?>">
                        <p style="font-size: 16px;">更多资讯</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('index/link'); ?>">
                        <p style="font-size: 16px;">友情链接</p>
                    </a>
                </li>
                <?php if($user_info): ?>
                <li class="nav-item active">
                    <a class="nav-link" href="<?php echo url('User/index'); ?>">
                        <p><?php echo htmlentities($user_info->name); ?></p>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('Login/logout'); ?>">
                        <p>退出</p>
                    </a>
                </li>
                <?php else: if($registered): ?>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('Login/index'); ?>">
                        <p>登录</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('Login/register'); ?>">
                        <p>注册</p>
                    </a>
                </li>
                <?php else: ?>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo url('Login/index'); ?>">
                        <p>登录</p>
                    </a>
                </li>
                <?php endif; ?>
                <?php endif; ?>
            </ul>
        </div>
    </div>
</nav>
<!-- 向下推65像素 -->
<div style="height: 65px;"></div>

<!-- 防止闪屏 -->
<script src="/static/index/moban/assets/js/plugins/jquery.sharrre.js" type="text/javascript"></script>
<!-- Code JS File -->
<script src="/static/index/moban/assets/js/core/jquery.3.2.1.min.js" type="text/javascript"></script>
<script src="/static/index/moban/assets/js/core/popper.min.js" type="text/javascript"></script>
<script src="/static/index/moban/assets/js/core/bootstrap.min.js" type="text/javascript"></script>

<!-- 弹出层 -->
<script src="/static/admin/lib/layer/layer.js"></script>

<!-- 模板动作 -->
<script src="/static/index/moban/assets/js/now-ui-kit.js?v=1.1.0" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        // the body of this function is in assets/js/now-ui-kit.js
        nowuiKit.initSliders();
    });

    function scrollToDownload() {

        if ($('.section-download').length != 0) {
            $("html, body").animate({
                scrollTop: $('.section-download').offset().top
            }, 1000);
        }
    }
</script>

    <div class="container" style="min-height: 410px;">
        <div class="row" style="margin-top: 80px;">
            <!-- 昵称 年龄 Start -->
            <div class="col-md-1"></div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        昵称
                    </span>
                    <input id="name" type="text" class="form-control" placeholder="请输入昵称"
                        value="<?php echo htmlentities($user_info_data['name']); ?>">
                </div>
            </div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        年龄
                    </span>
                    <input id="age" type="number" class="form-control" placeholder="请输入年龄" value="<?php echo htmlentities($user_info_data['age']); ?>">
                </div>
            </div>
            <div class="col-md-1"></div>
            <!-- 昵称 年龄 End -->


            <!-- 职务 手机 Start -->
            <div class="col-md-1"></div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        职务
                    </span>
                    <input id="position" type="text" class="form-control" placeholder="请输入职务"
                        value="<?php echo htmlentities($user_info_data['position']); ?>">
                </div>
            </div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        手机
                    </span>
                    <input id="phone" type="number" class="form-control" placeholder="请输入手机"
                        value="<?php echo htmlentities($user_info_data['phone']); ?>">
                </div>
            </div>
            <div class="col-md-1"></div>
            <!-- 职务 手机 End -->

            <!-- 邮箱 QQ Start -->
            <div class="col-md-1"></div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        邮箱
                    </span>
                    <input id="email" type="text" class="form-control" placeholder="请输入邮箱"
                        value="<?php echo htmlentities($user_info_data['email']); ?>">
                </div>
            </div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        QQ
                    </span>
                    <input id="qq" type="number" class="form-control" placeholder="请输入QQ" value="<?php echo htmlentities($user_info_data['qq']); ?>">
                </div>
            </div>
            <div class="col-md-1"></div>
            <!-- 邮箱 QQ End -->

            <!-- 办公室电话 微信 Start -->
            <div class="col-md-1"></div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        办公室电话
                    </span>
                    <input id="tel" type="text" class="form-control" placeholder="请输入办公室电话"
                        value="<?php echo htmlentities($user_info_data['tel']); ?>">
                </div>
            </div>
            <div class="col-md-5">
                <div class="input-group">
                    <span class="input-group-addon">
                        微信
                    </span>
                    <input id="wx" type="text" class="form-control" placeholder="请输入微信" value="<?php echo htmlentities($user_info_data['wx']); ?>">
                </div>
            </div>
            <div class="col-md-1"></div>
            <!-- 办公室电话 微信 End -->

            <!-- 办公室地址 Start -->
            <div class="col-md-1"></div>
            <div class="col-md-10">
                <div class="input-group">
                    <span class="input-group-addon">
                        办公室地址
                    </span>
                    <input id="address" type="text" class="form-control" placeholder="请输入办公室地址"
                        value="<?php echo htmlentities($user_info_data['address']); ?>">
                </div>
            </div>
            <div class="col-md-1"></div>
            <!-- 办公室地址 End -->
            
            <div class="col-md-6" style="text-align: center;">
                <button id="save" class="btn btn-success btn-round btn-lg">点击修改</button>
            </div>
            <div class="col-md-6" style="text-align: center;">
                <button id="back" class="btn btn-info btn-round btn-lg">点击返回</button>
            </div>

        </div>
    </div>
    <!-- 引入页脚 -->
    <footer class="footer " style="background-color: #ddd;">
    <div style="text-align: center;">
        Copyright © 2020 夏立军 山东建筑大学-成果管理系统 201611106025
    </div>
</footer>

    <script>

        // 点击保存
        $('#save').on('click',function(){
            // 收集数据
            var id = "<?php echo htmlentities($user_info_data['id']); ?>";
            var name = $('#name').val().trim();
            var age = $('#age').val().trim();
            var position = $('#position').val().trim();
            var phone = $('#phone').val().trim();
            var email = $('#email').val().trim();
            var qq = $('#qq').val().trim();
            var tel= $('#tel').val().trim();
            var wx= $('#wx').val().trim();
            var address= $('#address').val().trim();

            var data = {
                'id':id,
                'name':name,
                'age':age,
                'position':position,
                'phone':phone,
                'email':email,
                'qq':qq,
                'tel':tel,
                'wx':wx,
                'address':address,
            };

            $.ajax({
                url: "<?php echo url('User/user_edit'); ?>",
                data: data,
                type: "POST",
                dataType: "JSON",
                success: function (res) {
                    // 返回结果处理
                    if (res.code == 0) {
                        return layer.msg(res.msg, { icon: 1, time: 900 });
                    } else {
                        return layer.msg(res.msg, { icon: 2, time: 900 });
                    }
                }
            });
        }); 

        // 点击返回
        $('#back').on('click',function(){
            window.location.href=document.referrer;
        });

    </script>


</body>

</html>